#ifndef DICTDATADLG_H
#define DICTDATADLG_H

#include "api/systemManager/dictionarymanagerapi.h"
#include <QDialog>

#include <Entity/DictData.h>
#include <Entity/DictType.h>

namespace Ui {
class DictDataDlg;
}

class DictDataDlg : public QDialog
{
    Q_OBJECT

public:
    explicit DictDataDlg(qlonglong id,QList<DictData> statusList,
                         QString dictType,QWidget *parent = nullptr);
    ~DictDataDlg();

private:
    Ui::DictDataDlg *ui;
    QList<DictData> statusList;
    QList<DictType> optionList;
    DictionaryManagerApi api;
    qlonglong dictId;
    QString type;
    DictType dictType;
    QList<DictData> dictDataList;
    int pageSize = 10;
    int total;
    int currentPage = 1;
    int totalPage;
    Utils utils;

    void init();
    void getOptionList();
    void getDictType();
    void getList();
    void initSearchArea();
    void initTable();
    void initPageInfo();


private slots:
    void on_btn_close_clicked();
    void on_comboBox_pageItem_currentIndexChanged(int index);
    void on_btn_pervious_clicked();
    void on_btn_next_clicked();
    void on_btn_hideSearch_clicked();
    void on_btn_refresh_clicked();
    void on_btn_search_clicked();
    void on_btn_reset_clicked();
    void on_lineEdit_gotoPage_returnPressed();
    void on_btn_add_clicked();
    void on_btn_del_clicked();
    void on_btn_update_clicked();
    void on_btn_export_clicked();
};


#endif // DICTDATADLG_H
